from django.test import TestCase

from user_app.models import AccountInfo
from forum.models import Topic


class TopicTestCase(TestCase):
    def setUp(self):
        ac = AccountInfo.objects.get(id=3)
        print(ac)
        # t_topic = Topic()
        # t_topic.subject = "测试发布标题"
        # t_topic.account_info = AccountInfo.objects.get(id=3)
        # t_topic.account_info = AccountInfo.objects.get(id=3)
        # t_topic.save()

    def test_animals_can_speak(self):
        t_topic = Topic.objects.get(subject="测试发布标题")
        self.assertEqual(t_topic.subject, "测试发布标题")
